package com.mysqlpass.update.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 测试控制器，用于验证Spring Boot控制器功能是否正常工作
 */
@Controller
public class TestController {
    
    /**
     * 提供简单的测试端点
     * @return 简单的文本响应
     */
    @GetMapping("/update/test")
    public ResponseEntity<String> testEndpoint() {
        return ResponseEntity.ok("Test endpoint is working!");
    }
    
    /**
     * 测试文件下载功能的简化版端点
     * @return 文件下载响应
     */
    @GetMapping("/update/test-download")
    public ResponseEntity<String> testDownload() {
        return ResponseEntity.ok()
                .header("Content-Disposition", "attachment; filename=test.txt")
                .header("Content-Type", "text/plain")
                .body("This is a test file content.");
    }
}